/*
 * @Description: 表单
 * @Author: Zzt
 * @Date: 2022-08-09 14:59:01
 * @LastEditTime: 2022-08-09 16:15:59
 */

import { Form, Input, Radio } from 'antd';
import type { RadioChangeEvent } from 'antd';
import { useState } from 'react';

const { TextArea } = Input;

const FormItem = (props: any) => {
  const [value, setValue] = useState(1);
  const onChange = (event: RadioChangeEvent) => {
    console.log('radio checked', event.target.value);
    setValue(event.target.value);
  };
  return (
    <>
      <Form.Item
        label="任务名称"
        name="taskname"
        colon={false}
        rules={[{ required: true, message: '请输入任务名称，不可重复' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item
        label="表达式编写"
        colon={false}
        extra="请根据Cron规则设计任务表达式"
        name="crone"
        rules={[{ required: true, message: '请输入cron表达式' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item name="state" label="启用状态" colon={false}>
        <Radio.Group>
          <Radio value={'开启'}>开启</Radio>
          <Radio value={'关闭'}>关闭</Radio>
        </Radio.Group>
      </Form.Item>
      <Form.Item label="备注" name="remark" colon={false}>
        <TextArea rows={4} placeholder="请输入执行任务备注" />
      </Form.Item>
    </>
  );
};
export default FormItem;
